package cn.myschool.printerano;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author oldliu
 * @since 1.0
 */
@Service
public class Printer {
    @Value("惠普炫彩系列")
    private String brand;//品牌
    @Value("999")
    private int price;//价格
    @Resource(name = "color")
    private Ink ink;
    @Resource(name = "b5")
    private TextPaper paper;

    public  Printer(){

    }

    public Printer(String brand, int price) {
        this.brand = brand;
        this.price = price;
    }

    //打印
    public void print(String s){
        System.out.println("当前"+brand+"打印机价格是"+this.price+"开始打印");
        System.out.println("使用"+ink.getColor());
        paper.print(s);
    }
//    public void setBrand(String brand) {
//        this.brand = brand;
//    }
//
//    public void setPrice(int price) {
//        this.price = price;
//    }



}
